home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / rexx / wbrexx_1_1.lzh / areq.c next >
C/C++ Source or Header  |  1988-05-18  |  1KB  |  48 lines

  1. /** ARreq.c
  2. *
  3. *                     Copyright 1988, W.G.J. Langeveld
  4. *                           All Rights Reserved
  5. *                           Freely Distributable
  6. *
  7. *    This routine puts up a simple boolean requester using the Amiga 
  8. *   AutoRequest function.
  9. *
  10. **/
  11. #include "functions.h"
  12. #include "exec/types.h"
  13. #include "intuition/intuition.h"
  14.  
  15. struct IntuiText ARText1 = {0,1,JAM1,15,10,NULL,NULL,NULL,};
  16. struct IntuiText ARText2 = {0,1,JAM1,6,3,NULL,NULL,NULL,};
  17. struct IntuiText ARText3 = {0,1,JAM1,6,3,NULL,NULL,NULL,};
  18.  
  19. /**
  20. *
  21. *   Simple true/false requester, using AutoRequest
  22. *
  23. **/
  24. int AReqBool(window,string,positive,negative)
  25. struct Window *window;
  26. char *string, *positive, *negative;
  27. {
  28.    long textlength;
  29.    struct IntuiText *a, *b;
  30.  
  31.    ARText1.IText = (UBYTE *)string;
  32.    ARText2.IText = (UBYTE *)positive;
  33.    ARText3.IText = (UBYTE *)negative;
  34.  
  35.    textlength = IntuiTextLength(&ARText1) + 50L;
  36.  
  37.    a = NULL;
  38.    b = NULL;
  39.  
  40.    if (positive != NULL) a = &ARText2;
  41.    if (negative != NULL) b = &ARText3;
  42.       
  43.    if (AutoRequest(window,&ARText1,a,b,NULL,NULL,textlength,60L))
  44.       return(1);
  45.    else
  46.       return(0);
  47. }
  48.